# include<cstdio>
#define MAX 1000

int find(int n, int m) {
	if (m == n || m == 1)
	{
		return 1;
	}
	else
	{
		return find(n - 1, m - 1) + find(n - 1, m) * m;
	}
}

int main() {
	int n;
	scanf("%d",&n);
	int sum = 0;
	for (int i = 1; i <= n; i++)
	{
		sum += find(n, i);
	}
	printf("%d",sum);
	return 0;
}